import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import tag from '../14.MyTag.vue'
import First from '../tabs/First.vue'
import Second from '../tabs/Second.vue'
import Third from '../tabs/Third.vue'
import NotFound from '../tabs/404.vue'

Vue.use(VueRouter)

/* 路由规则 */
const routes = [
  {
    path:'/',//路由值
    name:'First',
    // redirect:'/qqqq',
    component:First
  },
  {
    path:'/second',
    name:'Second',
    component:Second
  },
  {
    path:'/third/:ids/:name',
    name:'Third',
    component:Third,
    // props: route => ({ query: route.query.q })
  },
  {
    path:'*',//一定要放在最后，表示可以匹配所有的路径
    name:'NotFound',
    component:NotFound,
    // props: { newsletterPopup: false,default: true, sidebar: false }
  }
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/tag',
  //   name: 'tag',
  //   component: tag
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  // linkActiveClass: 'aa',
  // linkExactActiveClass: 'bb',
  mode:'hash',//配置路由模式
  routes:routes
})

export default router
